myApp.factory('$serMaganerNodeAdmin', function( $resource){
	var setSend = function(data, url){
			data = data || {};
			url = admin_url + url;
			return $resource(url)
				.save(data)
				.$promise;
		};
	return {
		/*获取节点列表*/
		list: function(data){
			return setSend(data, 'WorkerNode/getList');
		},
		/*获取节点详情*/
		detail: function(data){
			return setSend(data, 'WorkerNode/getDetail');
		},
		/*获取控制器节点列表*/
		ctrlList: function(data){
			return setSend(data, 'WorkerNode/getControllerNode');
		},
		/*获取方法节点列表*/
		fnList: function(data){
			return setSend(data, 'WorkerNode/getFunctionNode');
		},
		/*增加节点*/
		add: function(data){
			return setSend(data, 'WorkerNode/addNode');
		},
		/*编辑节点*/
		save: function(data){
			return setSend(data, 'WorkerNode/saveNode');
		},
		/*删除节点*/
		del: function(data){
			return setSend(data, 'WorkerNode/deleteNode');
		},
		/*获取节点树*/
		tree: function(data){
			return setSend(data, 'WorkerNode/getAllNode');
		}
	}
});